package com.zm.dao.impl;

import com.zm.dao.IAccountDao;
import com.zm.domain.account;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
@Repository("accountDao")
public class AccountDaoimpl implements IAccountDao {
    @Resource(name="runner")
    private QueryRunner runner;

    public void setRunner(QueryRunner runner) {
        this.runner = runner;
    }
    public List<account> findAllAccount() {

        try {
            return runner.query("select * from account", new BeanListHandler<account>(account.class));
        } catch (Exception e) {
            e.printStackTrace();
        }
    return null;
    }

    public List<account> findAllcountById(Integer id) {

        return null;
    }

}
